package chap9;

public class DatabaseBean {
	private StudentBean studentArry[];
	
	public DatabaseBean(){
		studentArry = new StudentBean[100];
	}
	
	public StudentBean[] getStudentArry(){
		DatabaseAccess da = new DatabaseAccess();
		return da.showAll();
	}
	
	public void addStudent(StudentBean stu){
		DatabaseAccess da = new DatabaseAccess();
		da.addOne(stu.getName(), stu.getAge()
				, stu.getSex(), stu.getHome(), stu.getSchool());
	}
	
	public static void main(String arg[]){
		DatabaseBean db = new DatabaseBean();
		StudentBean student[] = db.getStudentArry();
    	for(int i = 0;i<student.length;i++){
			System.out.println("line: "+ i+ " Name:" + student[i].getName()
					+" sex:" + student[i].getSex()
					+" age:" + student[i].getAge()
					+" home:" + student[i].getHome()
					+" School:" + student[i].getSchool()+"<br>");
		}
	}
	
	

}
